<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of ErrorHandler
 *
 * @author Amos
 */
class ErrorHandler {
    
    protected $errormsg;
    protected $control;


    public function __construct($control) {
        $this->errormsg = array();
        $this->control = $control;
    }

    public function addErrorMsg($key, $message) {
        $this->errormsg = array( $key => '<span class="errormsg">' . $message . '</span>' );
    }
    
    public function removeErrorMsg($key) {
        unset($this->errormsg[$key]);
    }
    
    public function getErrorMsg($key) {
        return $this->errormsg[$key];
    }
    
}
?>
